import React, { useEffect, useState } from 'react';
export interface User {
    id: string;
    username: string;
    token: string;
}
interface SearchPanelProps {
    users: User[];
    param: {
        name: string;
        personId: string;
    };
    setParam: (param: SearchPanelProps['param']) => void;
}
const SearchPanel = ({ param, setParam, users }: SearchPanelProps) => {
    return (
        <form action="">
            <input
                type="text"
                value={param.name}
                onChange={(e) =>
                    setParam({
                        ...param,
                        name: e.target.value,
                    })
                }
            />
            <select
                value={param.personId}
                onChange={(e) =>
                    setParam({
                        ...param,
                        personId: e.target.value,
                    })
                }
            >
                <option key="fuzeren" value="">
                    负责人
                </option>
                {users.map((user) => (
                    <option key={user.id} value={user.id}>
                        {user.username}
                    </option>
                ))}
            </select>
        </form>
    );
};

export default SearchPanel;
